package top.tangyh.lamp.care.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import top.tangyh.basic.base.service.SuperService;
import top.tangyh.lamp.care.entity.BCarePgVte;
import top.tangyh.lamp.care.vo.result.Apache2Statstic;
import top.tangyh.lamp.care.vo.result.BCarePgVteVO;
import top.tangyh.lamp.care.vo.result.CarePgVteVO;
import top.tangyh.lamp.care.vo.save.BCarePgVteSaveVO;
import top.tangyh.lamp.care.vo.update.BCarePgVteUpdateVO;
import top.tangyh.lamp.care.vo.result.BCarePgVteResultVO;
import top.tangyh.lamp.care.vo.query.BCarePgVtePageQuery;

import java.util.List;
import java.util.Map;
import java.util.Set;


/**
 * <p>
 * 业务接口
 * vte风险评分
 * </p>
 *
 * @author zqb
 * @date 2024-07-08 16:40:03
 * @create [2024-07-08 16:40:03] [zqb] [代码生成器生成]
 */
public interface BCarePgVteService extends SuperService<Long, BCarePgVte> {

    /**
     * 质控 apacheII  评分分页查询
     *
     * @param startTime
     * @param endTime
     * @param page
     * @param size
     * @return
     */
    Page<BCarePgVteResultVO> getPagedApacheIIResult(String startTime, String endTime, int page, int size);

    void checkPg(BCarePgVteSaveVO yxCarePgVteVO);

    BCarePgVte getLastNewCarePgRecord(int type, String dateStr, String patientIdent);

    BCarePgVte getLastNewCarePgRecord(int type, String patientIdent, Long rkTime, Long ckTime);

    BCarePgVte getFirstCarePgRecord(int type, String dateStr, String patientIdent);

    /**
     * 查询某个病人最新评分里的三个总评分里的最新的评分
     *
     * @param patientIdent
     * @return
     */
    String getVteOfTopNewScore(String patientIdent);

    Map<String, String> getVteOfTopNewScoreByList(List<String> patientIdent);


    void saveList(List<CarePgVteVO> pgs, Long recordTime, String operator, String patientIdent, Set<Integer> pgpfs);


    Map<Integer, CarePgVteVO> selectLatestByParams(String patientIdent, String hospitalNumber, Set<Integer> vte, Long recordTime, Long rkTime);


    /**
     * 入ICU后首次APACHEⅡ评分≥15分的患者
     *
     * @param startTime
     * @param endTime
     * @return
     */
    List<BCarePgVteVO> getFirstApacheiiPatients(String startTime, String endTime);

    List<Apache2Statstic> selectApacheIIFirstStatistics(@Param("startTime") String startTime,
                                                        @Param("endTime") String endTime);
}


